package com.ylbh.modules.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.member.dto.BusinessAnalysisDTO;
import com.ylbh.common.pojo.member.dto.MemberDTO;
import com.ylbh.common.pojo.member.vo.*;
import com.ylbh.common.utils.PageDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author: czx
 * @date: 2019/07/24 11:25
 * 会员分析
 */
@Mapper
@Repository
public interface MembershipAnalysisMapper extends BaseMapper<MemberDTO> {

    /**
     * 会员活跃度列表
     * @param page
     * @return
     */
    List<MembershipActivityVO> selectMembershipActivityList(@Param(value = "businessAnalysisDTO") BusinessAnalysisDTO businessAnalysisDTO, Page page);

    List<ConsumptionInformationVO> selectConsumptionInformation(@Param(value = "id") Integer id);

    List<BusinessAnalysisVO> selectBusinessAnalysisList(@Param(value = "businessAnalysisDTO") BusinessAnalysisDTO businessAnalysisDTO,
                                                        Page<Integer> page);

    List<Integer> selectMonthOrderTotal(@Param(value = "id") Long id,
                                        @Param(value = "january1st") String january1st,
                                        @Param(value = "date") Date date);

    List<Integer> selectWeeklyOrderTotal(@Param(value = "id") Long id,
                                         @Param(value = "monday") String monday,
                                         @Param(value = "sameday") String sameday);

    /**
     * 商城订单分析列表
     * @param businessAnalysisDTO
     * @param page
     * @return
     */
    List<GoodsAnalysisVO> selectGoodsAnalysisList(@Param(value = "businessAnalysisDTO") BusinessAnalysisDTO businessAnalysisDTO, Page<Integer> page);

    /**
     * 导出会员活跃度
     * @param startTime
     * @param endTime
     * @param keywords
     * @param userType
     * @return
     */
    List<MembershipActivityListExcelVO> selectMembershipActivityListExcel(@Param(value = "startTime") String startTime,
                                                                          @Param(value = "endTime") String endTime,
                                                                          @Param(value = "keywords") String keywords,
                                                                          @Param(value = "userType") String userType);

    /**
     * 导出会员活跃度
     * @param businessAnalysisDTO
     * @return
     */
    List<OrderAnalysisOfMallExcel> selectOrderAnalysisOfMallExcel(@Param(value = "businessAnalysisDTO") BusinessAnalysisDTO businessAnalysisDTO);

    /**
     * 联盟店订单分析导出
     * @param businessAnalysisDTO
     * @return
     */
    List<OrderAnalysisOfAllianceStoresExcel> selectOrderAnalysisOfAllianceStores(@Param(value = "businessAnalysisDTO") BusinessAnalysisDTO businessAnalysisDTO);
}
